<template>
	<view class="coupon-list-warp">
		<Tabs
			fixed
			:current="current"
			:values="items"
			:scrollFlag='true'
			:isEqually='true'
			@clickItem="selectTab"
		/>
		<swiper class="swiper" @change='changePage' :current='current'>
			<swiper-item v-for="(item,index) in items" :key='index'>
				<scroll-view scroll-y="true" class="tab">
					<Coupon
						
					/>
				</scroll-view>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import Tabs from '../../components/tabs.vue'
	import Coupon from '../../components/coupon.vue'
	export default {
		data() {
			return {
				items: ['可用券(4)', '已使用(4)', '已转赠(4)', '已过期(4)'],
				current: 0
			};
		},
		components: {
			Tabs,
			Coupon
		},
		methods: {
			selectTab(e) {
				this.current = e.currentIndex
			},
			changePage(e){
				this.current = e.target.current
			}
		}
	}
</script>

<style lang="less">
	.coupon-list-warp {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		.swiper {
			margin-top: 88rpx;
			height: 100%;
			.tab {
				padding: 12rpx 0;
			}
		}
	}
</style>
